<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lesson 7</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
  <div id="root"></div>
</body>
<script>
  // slot 具名插槽 每个插槽有一个具体的名字做标识

  const app = Vue.createApp({

    data(){
      return {
        title: '提交111'
      }
    },

    template: `
      <layout>
        <template v-slot:header>
          <div>header</div>
        </template>
        <template v-slot:footer>
          <div>footer</div>
        </template>
      </layout>
    `
  });


  app.component('layout', {
    props: ['content'],
    methods: {
      handleClick(){
        alert(123);
      },
    },
    template: `
      <div>
      <slot name="header"></slot>
      <div>content</div>
      <slot name="footer"></slot>
      </div>
      `
  })


  const vm = app.mount('#root');
</script>
</html>